package org.neuedu.chapter09_0629.demo05;

public class StringDemo01 {
    public static void main(String[] args) {
        String str1 = "hello"; // 创建了一个对象
        String str2 = "hello";
        String str3 = new String("hello");// 创建了2个对象
        System.out.println(str1 == str2);// true
        System.out.println(str1 == str3);// false
        System.out.println(str1.equals(str3)); // true

        StringBuffer sb1 = new StringBuffer("hello");
        StringBuilder sb2 = new StringBuilder("hello");
    }
}
